Skip to content

fix(ui): open folder/document items in new tab on modifier click#15873

Open
mibragimov wants to merge 1 commit intopayloadcms:mainfrom
mibragimov:fix/issue-15837-open-folder-links-new-tab
Open

fix(ui): open folder/document items in new tab on modifier click#15873
mibragimov wants to merge 1 commit intopayloadcms:mainfrom
mibragimov:fix/issue-15837-open-folder-links-new-tab

Conversation

@mibragimov
Copy link

Summary

Fix folder/document navigation in folder views so modifier-click behaves like normal links.

cmd / ctrl / shift + click on folder cards or list rows currently routes in-place via router.push, which prevents opening in a new tab.

This PR adds modifier-aware behavior:

  • cmd / ctrl / shift + click opens the target in a new tab
  • regular click/double-click behavior still navigates in the current tab

Changes

  • Extended navigateAfterSelection with an openInNewTab option.
  • Unified target URL building and route handling.
  • For modifier-clicks, uses window.open(targetURL, '_blank', 'noopener,noreferrer').
  • Updated item click handling to route modifier-clicks through openInNewTab.

Validation

  • pnpm exec eslint packages/ui/src/providers/Folders/index.tsx

Closes #15837

…odifiers

Folder list rows and folder cards currently navigate via router.push on
interaction, so modifier-click behaviors (cmd/ctrl/shift) do not open a new
tab like regular links.

This change adds modifier-aware navigation:
- cmd/ctrl/shift + click now opens the target folder/document in a new tab
- regular click/double-click behavior continues to route in the current tab

Fixes payloadcms#15837
@mibragimov mibragimov changed the title fix(folders): open folder/document items in new tab on modifier click fix(ui): open folder/document items in new tab on modifier click Mar 7, 2026
@mibragimov mibragimov marked this pull request as ready for review March 7, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CMD/Shift + Click does not open list/folder links in new tab

1 participant